using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;

namespace Adex
{
	/// <summary>
	/// Strongly-typed collection for the InternetLog class.
	/// </summary>
	[Serializable]
	public partial class InternetLogCollection : ActiveList<InternetLog, InternetLogCollection> 
	{	   
		public InternetLogCollection() {}

	}

	/// <summary>
	/// This is an ActiveRecord class which wraps the InternetLog table.
	/// </summary>
	[Serializable]
	public partial class InternetLog : ActiveRecord<InternetLog>
	{
		#region .ctors and Default Settings
		
		public InternetLog()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}

		
		private void InitSetDefaults() { SetDefaults(); }

		
		public InternetLog(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}

		public InternetLog(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}

		 
		public InternetLog(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}

		
		protected static void SetSQLProps() { GetTableSchema(); }

		
		#endregion
		
		#region Schema and Query Accessor
		public static Query CreateQuery() { return new Query(Schema); }

		
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}

		}

		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("InternetLog", TableType.Table, DataService.GetInstance("Adex"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarInternetLogID = new TableSchema.TableColumn(schema);
				colvarInternetLogID.ColumnName = "InternetLogID";
				colvarInternetLogID.DataType = DbType.Int32;
				colvarInternetLogID.MaxLength = 0;
				colvarInternetLogID.AutoIncrement = true;
				colvarInternetLogID.IsNullable = false;
				colvarInternetLogID.IsPrimaryKey = true;
				colvarInternetLogID.IsForeignKey = false;
				colvarInternetLogID.IsReadOnly = false;
				colvarInternetLogID.DefaultSetting = @"";
				colvarInternetLogID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarInternetLogID);
				
				TableSchema.TableColumn colvarCountryID = new TableSchema.TableColumn(schema);
				colvarCountryID.ColumnName = "CountryID";
				colvarCountryID.DataType = DbType.Byte;
				colvarCountryID.MaxLength = 0;
				colvarCountryID.AutoIncrement = false;
				colvarCountryID.IsNullable = true;
				colvarCountryID.IsPrimaryKey = false;
				colvarCountryID.IsForeignKey = true;
				colvarCountryID.IsReadOnly = false;
				colvarCountryID.DefaultSetting = @"";
				
					colvarCountryID.ForeignKeyTableName = "Country";
				schema.Columns.Add(colvarCountryID);
				
				TableSchema.TableColumn colvarRFDate = new TableSchema.TableColumn(schema);
				colvarRFDate.ColumnName = "RFDate";
				colvarRFDate.DataType = DbType.DateTime;
				colvarRFDate.MaxLength = 0;
				colvarRFDate.AutoIncrement = false;
				colvarRFDate.IsNullable = true;
				colvarRFDate.IsPrimaryKey = false;
				colvarRFDate.IsForeignKey = false;
				colvarRFDate.IsReadOnly = false;
				colvarRFDate.DefaultSetting = @"";
				colvarRFDate.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRFDate);
				
				TableSchema.TableColumn colvarMediaCode = new TableSchema.TableColumn(schema);
				colvarMediaCode.ColumnName = "MediaCode";
				colvarMediaCode.DataType = DbType.Int32;
				colvarMediaCode.MaxLength = 0;
				colvarMediaCode.AutoIncrement = false;
				colvarMediaCode.IsNullable = true;
				colvarMediaCode.IsPrimaryKey = false;
				colvarMediaCode.IsForeignKey = true;
				colvarMediaCode.IsReadOnly = false;
				colvarMediaCode.DefaultSetting = @"";
				
					colvarMediaCode.ForeignKeyTableName = "Medium";
				schema.Columns.Add(colvarMediaCode);
				
				TableSchema.TableColumn colvarTimeStart = new TableSchema.TableColumn(schema);
				colvarTimeStart.ColumnName = "TimeStart";
				colvarTimeStart.DataType = DbType.Int32;
				colvarTimeStart.MaxLength = 0;
				colvarTimeStart.AutoIncrement = false;
				colvarTimeStart.IsNullable = true;
				colvarTimeStart.IsPrimaryKey = false;
				colvarTimeStart.IsForeignKey = false;
				colvarTimeStart.IsReadOnly = false;
				colvarTimeStart.DefaultSetting = @"";
				colvarTimeStart.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTimeStart);
				
				TableSchema.TableColumn colvarTimeEnd = new TableSchema.TableColumn(schema);
				colvarTimeEnd.ColumnName = "TimeEnd";
				colvarTimeEnd.DataType = DbType.Int32;
				colvarTimeEnd.MaxLength = 0;
				colvarTimeEnd.AutoIncrement = false;
				colvarTimeEnd.IsNullable = true;
				colvarTimeEnd.IsPrimaryKey = false;
				colvarTimeEnd.IsForeignKey = false;
				colvarTimeEnd.IsReadOnly = false;
				colvarTimeEnd.DefaultSetting = @"";
				colvarTimeEnd.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTimeEnd);
				
				TableSchema.TableColumn colvarPageNumber = new TableSchema.TableColumn(schema);
				colvarPageNumber.ColumnName = "PageNumber";
				colvarPageNumber.DataType = DbType.Int32;
				colvarPageNumber.MaxLength = 0;
				colvarPageNumber.AutoIncrement = false;
				colvarPageNumber.IsNullable = true;
				colvarPageNumber.IsPrimaryKey = false;
				colvarPageNumber.IsForeignKey = false;
				colvarPageNumber.IsReadOnly = false;
				colvarPageNumber.DefaultSetting = @"";
				colvarPageNumber.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPageNumber);
				
				TableSchema.TableColumn colvarInternetBodyCode = new TableSchema.TableColumn(schema);
				colvarInternetBodyCode.ColumnName = "InternetBodyCode";
				colvarInternetBodyCode.DataType = DbType.Int32;
				colvarInternetBodyCode.MaxLength = 0;
				colvarInternetBodyCode.AutoIncrement = false;
				colvarInternetBodyCode.IsNullable = true;
				colvarInternetBodyCode.IsPrimaryKey = false;
				colvarInternetBodyCode.IsForeignKey = true;
				colvarInternetBodyCode.IsReadOnly = false;
				colvarInternetBodyCode.DefaultSetting = @"";
				
					colvarInternetBodyCode.ForeignKeyTableName = "InternetBody";
				schema.Columns.Add(colvarInternetBodyCode);
				
				TableSchema.TableColumn colvarTipology = new TableSchema.TableColumn(schema);
				colvarTipology.ColumnName = "Tipology";
				colvarTipology.DataType = DbType.String;
				colvarTipology.MaxLength = 5;
				colvarTipology.AutoIncrement = false;
				colvarTipology.IsNullable = true;
				colvarTipology.IsPrimaryKey = false;
				colvarTipology.IsForeignKey = false;
				colvarTipology.IsReadOnly = false;
				colvarTipology.DefaultSetting = @"";
				colvarTipology.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTipology);
				
				TableSchema.TableColumn colvarRealCost = new TableSchema.TableColumn(schema);
				colvarRealCost.ColumnName = "RealCost";
				colvarRealCost.DataType = DbType.Currency;
				colvarRealCost.MaxLength = 0;
				colvarRealCost.AutoIncrement = false;
				colvarRealCost.IsNullable = true;
				colvarRealCost.IsPrimaryKey = false;
				colvarRealCost.IsForeignKey = false;
				colvarRealCost.IsReadOnly = false;
				colvarRealCost.DefaultSetting = @"";
				colvarRealCost.ForeignKeyTableName = "";
				schema.Columns.Add(colvarRealCost);
				
				TableSchema.TableColumn colvarWide = new TableSchema.TableColumn(schema);
				colvarWide.ColumnName = "Wide";
				colvarWide.DataType = DbType.Double;
				colvarWide.MaxLength = 0;
				colvarWide.AutoIncrement = false;
				colvarWide.IsNullable = true;
				colvarWide.IsPrimaryKey = false;
				colvarWide.IsForeignKey = false;
				colvarWide.IsReadOnly = false;
				colvarWide.DefaultSetting = @"";
				colvarWide.ForeignKeyTableName = "";
				schema.Columns.Add(colvarWide);
				
				TableSchema.TableColumn colvarPageType = new TableSchema.TableColumn(schema);
				colvarPageType.ColumnName = "PageType";
				colvarPageType.DataType = DbType.Int32;
				colvarPageType.MaxLength = 0;
				colvarPageType.AutoIncrement = false;
				colvarPageType.IsNullable = true;
				colvarPageType.IsPrimaryKey = false;
				colvarPageType.IsForeignKey = false;
				colvarPageType.IsReadOnly = false;
				colvarPageType.DefaultSetting = @"";
				colvarPageType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPageType);
				
				TableSchema.TableColumn colvarLength = new TableSchema.TableColumn(schema);
				colvarLength.ColumnName = "Length";
				colvarLength.DataType = DbType.Double;
				colvarLength.MaxLength = 0;
				colvarLength.AutoIncrement = false;
				colvarLength.IsNullable = true;
				colvarLength.IsPrimaryKey = false;
				colvarLength.IsForeignKey = false;
				colvarLength.IsReadOnly = false;
				colvarLength.DefaultSetting = @"";
				colvarLength.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLength);
				
				TableSchema.TableColumn colvarClassCode = new TableSchema.TableColumn(schema);
				colvarClassCode.ColumnName = "ClassCode";
				colvarClassCode.DataType = DbType.String;
				colvarClassCode.MaxLength = 300;
				colvarClassCode.AutoIncrement = false;
				colvarClassCode.IsNullable = true;
				colvarClassCode.IsPrimaryKey = false;
				colvarClassCode.IsForeignKey = false;
				colvarClassCode.IsReadOnly = false;
				colvarClassCode.DefaultSetting = @"";
				colvarClassCode.ForeignKeyTableName = "";
				schema.Columns.Add(colvarClassCode);
				
				TableSchema.TableColumn colvarPages = new TableSchema.TableColumn(schema);
				colvarPages.ColumnName = "Pages";
				colvarPages.DataType = DbType.Int32;
				colvarPages.MaxLength = 0;
				colvarPages.AutoIncrement = false;
				colvarPages.IsNullable = true;
				colvarPages.IsPrimaryKey = false;
				colvarPages.IsForeignKey = false;
				colvarPages.IsReadOnly = false;
				colvarPages.DefaultSetting = @"";
				colvarPages.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPages);
				
				TableSchema.TableColumn colvarMeasure = new TableSchema.TableColumn(schema);
				colvarMeasure.ColumnName = "Measure";
				colvarMeasure.DataType = DbType.String;
				colvarMeasure.MaxLength = 300;
				colvarMeasure.AutoIncrement = false;
				colvarMeasure.IsNullable = true;
				colvarMeasure.IsPrimaryKey = false;
				colvarMeasure.IsForeignKey = false;
				colvarMeasure.IsReadOnly = false;
				colvarMeasure.DefaultSetting = @"";
				colvarMeasure.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMeasure);
				
				TableSchema.TableColumn colvarColorCode = new TableSchema.TableColumn(schema);
				colvarColorCode.ColumnName = "ColorCode";
				colvarColorCode.DataType = DbType.Int32;
				colvarColorCode.MaxLength = 0;
				colvarColorCode.AutoIncrement = false;
				colvarColorCode.IsNullable = true;
				colvarColorCode.IsPrimaryKey = false;
				colvarColorCode.IsForeignKey = true;
				colvarColorCode.IsReadOnly = false;
				colvarColorCode.DefaultSetting = @"";
				
					colvarColorCode.ForeignKeyTableName = "InternetColor";
				schema.Columns.Add(colvarColorCode);
				
				TableSchema.TableColumn colvarProductID = new TableSchema.TableColumn(schema);
				colvarProductID.ColumnName = "ProductID";
				colvarProductID.DataType = DbType.Int32;
				colvarProductID.MaxLength = 0;
				colvarProductID.AutoIncrement = false;
				colvarProductID.IsNullable = true;
				colvarProductID.IsPrimaryKey = false;
				colvarProductID.IsForeignKey = false;
				colvarProductID.IsReadOnly = false;
				colvarProductID.DefaultSetting = @"";
				colvarProductID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProductID);
				
				TableSchema.TableColumn colvarProdVersionID = new TableSchema.TableColumn(schema);
				colvarProdVersionID.ColumnName = "ProdVersionID";
				colvarProdVersionID.DataType = DbType.Int32;
				colvarProdVersionID.MaxLength = 0;
				colvarProdVersionID.AutoIncrement = false;
				colvarProdVersionID.IsNullable = false;
				colvarProdVersionID.IsPrimaryKey = false;
				colvarProdVersionID.IsForeignKey = false;
				colvarProdVersionID.IsReadOnly = false;
				colvarProdVersionID.DefaultSetting = @"";
				colvarProdVersionID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarProdVersionID);
				
				TableSchema.TableColumn colvarCategoryID = new TableSchema.TableColumn(schema);
				colvarCategoryID.ColumnName = "CategoryID";
				colvarCategoryID.DataType = DbType.Int32;
				colvarCategoryID.MaxLength = 0;
				colvarCategoryID.AutoIncrement = false;
				colvarCategoryID.IsNullable = true;
				colvarCategoryID.IsPrimaryKey = false;
				colvarCategoryID.IsForeignKey = false;
				colvarCategoryID.IsReadOnly = false;
				colvarCategoryID.DefaultSetting = @"";
				colvarCategoryID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCategoryID);
				
				TableSchema.TableColumn colvarSubSectorID = new TableSchema.TableColumn(schema);
				colvarSubSectorID.ColumnName = "SubSectorID";
				colvarSubSectorID.DataType = DbType.Int32;
				colvarSubSectorID.MaxLength = 0;
				colvarSubSectorID.AutoIncrement = false;
				colvarSubSectorID.IsNullable = true;
				colvarSubSectorID.IsPrimaryKey = false;
				colvarSubSectorID.IsForeignKey = false;
				colvarSubSectorID.IsReadOnly = false;
				colvarSubSectorID.DefaultSetting = @"";
				colvarSubSectorID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSubSectorID);
				
				TableSchema.TableColumn colvarSectorID = new TableSchema.TableColumn(schema);
				colvarSectorID.ColumnName = "SectorID";
				colvarSectorID.DataType = DbType.Int32;
				colvarSectorID.MaxLength = 0;
				colvarSectorID.AutoIncrement = false;
				colvarSectorID.IsNullable = true;
				colvarSectorID.IsPrimaryKey = false;
				colvarSectorID.IsForeignKey = false;
				colvarSectorID.IsReadOnly = false;
				colvarSectorID.DefaultSetting = @"";
				colvarSectorID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarSectorID);
				
				TableSchema.TableColumn colvarBrandID = new TableSchema.TableColumn(schema);
				colvarBrandID.ColumnName = "BrandID";
				colvarBrandID.DataType = DbType.Int32;
				colvarBrandID.MaxLength = 0;
				colvarBrandID.AutoIncrement = false;
				colvarBrandID.IsNullable = true;
				colvarBrandID.IsPrimaryKey = false;
				colvarBrandID.IsForeignKey = false;
				colvarBrandID.IsReadOnly = false;
				colvarBrandID.DefaultSetting = @"";
				colvarBrandID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarBrandID);
				
				TableSchema.TableColumn colvarAdvertiserID = new TableSchema.TableColumn(schema);
				colvarAdvertiserID.ColumnName = "AdvertiserID";
				colvarAdvertiserID.DataType = DbType.Int32;
				colvarAdvertiserID.MaxLength = 0;
				colvarAdvertiserID.AutoIncrement = false;
				colvarAdvertiserID.IsNullable = true;
				colvarAdvertiserID.IsPrimaryKey = false;
				colvarAdvertiserID.IsForeignKey = false;
				colvarAdvertiserID.IsReadOnly = false;
				colvarAdvertiserID.DefaultSetting = @"";
				colvarAdvertiserID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAdvertiserID);
				
				TableSchema.TableColumn colvarImageName = new TableSchema.TableColumn(schema);
				colvarImageName.ColumnName = "ImageName";
				colvarImageName.DataType = DbType.String;
				colvarImageName.MaxLength = 50;
				colvarImageName.AutoIncrement = false;
				colvarImageName.IsNullable = true;
				colvarImageName.IsPrimaryKey = false;
				colvarImageName.IsForeignKey = false;
				colvarImageName.IsReadOnly = false;
				colvarImageName.DefaultSetting = @"";
				colvarImageName.ForeignKeyTableName = "";
				schema.Columns.Add(colvarImageName);
				
				TableSchema.TableColumn colvarAgencyID = new TableSchema.TableColumn(schema);
				colvarAgencyID.ColumnName = "AgencyID";
				colvarAgencyID.DataType = DbType.Int32;
				colvarAgencyID.MaxLength = 0;
				colvarAgencyID.AutoIncrement = false;
				colvarAgencyID.IsNullable = true;
				colvarAgencyID.IsPrimaryKey = false;
				colvarAgencyID.IsForeignKey = false;
				colvarAgencyID.IsReadOnly = false;
				colvarAgencyID.DefaultSetting = @"";
				colvarAgencyID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAgencyID);
				
				TableSchema.TableColumn colvarDateAdded = new TableSchema.TableColumn(schema);
				colvarDateAdded.ColumnName = "DateAdded";
				colvarDateAdded.DataType = DbType.DateTime;
				colvarDateAdded.MaxLength = 0;
				colvarDateAdded.AutoIncrement = false;
				colvarDateAdded.IsNullable = false;
				colvarDateAdded.IsPrimaryKey = false;
				colvarDateAdded.IsForeignKey = false;
				colvarDateAdded.IsReadOnly = false;
				colvarDateAdded.DefaultSetting = @"";
				colvarDateAdded.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateAdded);
				
				TableSchema.TableColumn colvarDateModified = new TableSchema.TableColumn(schema);
				colvarDateModified.ColumnName = "DateModified";
				colvarDateModified.DataType = DbType.DateTime;
				colvarDateModified.MaxLength = 0;
				colvarDateModified.AutoIncrement = false;
				colvarDateModified.IsNullable = false;
				colvarDateModified.IsPrimaryKey = false;
				colvarDateModified.IsForeignKey = false;
				colvarDateModified.IsReadOnly = false;
				colvarDateModified.DefaultSetting = @"";
				colvarDateModified.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDateModified);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Adex"].AddSchema("InternetLog",schema);
			}

		}

		#endregion
		
		#region Props
		
		  
		[XmlAttribute("InternetLogID")]
		public int InternetLogID 
		{
			get { return GetColumnValue<int>("InternetLogID"); }

			set { SetColumnValue("InternetLogID", value); }

		}

		  
		[XmlAttribute("CountryID")]
		public byte? CountryID 
		{
			get { return GetColumnValue<byte?>("CountryID"); }

			set { SetColumnValue("CountryID", value); }

		}

		  
		[XmlAttribute("RFDate")]
		public DateTime? RFDate 
		{
			get { return GetColumnValue<DateTime?>("RFDate"); }

			set { SetColumnValue("RFDate", value); }

		}

		  
		[XmlAttribute("MediaCode")]
		public int? MediaCode 
		{
			get { return GetColumnValue<int?>("MediaCode"); }

			set { SetColumnValue("MediaCode", value); }

		}

		  
		[XmlAttribute("TimeStart")]
		public int? TimeStart 
		{
			get { return GetColumnValue<int?>("TimeStart"); }

			set { SetColumnValue("TimeStart", value); }

		}

		  
		[XmlAttribute("TimeEnd")]
		public int? TimeEnd 
		{
			get { return GetColumnValue<int?>("TimeEnd"); }

			set { SetColumnValue("TimeEnd", value); }

		}

		  
		[XmlAttribute("PageNumber")]
		public int? PageNumber 
		{
			get { return GetColumnValue<int?>("PageNumber"); }

			set { SetColumnValue("PageNumber", value); }

		}

		  
		[XmlAttribute("InternetBodyCode")]
		public int? InternetBodyCode 
		{
			get { return GetColumnValue<int?>("InternetBodyCode"); }

			set { SetColumnValue("InternetBodyCode", value); }

		}

		  
		[XmlAttribute("Tipology")]
		public string Tipology 
		{
			get { return GetColumnValue<string>("Tipology"); }

			set { SetColumnValue("Tipology", value); }

		}

		  
		[XmlAttribute("RealCost")]
		public decimal? RealCost 
		{
			get { return GetColumnValue<decimal?>("RealCost"); }

			set { SetColumnValue("RealCost", value); }

		}

		  
		[XmlAttribute("Wide")]
		public double? Wide 
		{
			get { return GetColumnValue<double?>("Wide"); }

			set { SetColumnValue("Wide", value); }

		}

		  
		[XmlAttribute("PageType")]
		public int? PageType 
		{
			get { return GetColumnValue<int?>("PageType"); }

			set { SetColumnValue("PageType", value); }

		}

		  
		[XmlAttribute("Length")]
		public double? Length 
		{
			get { return GetColumnValue<double?>("Length"); }

			set { SetColumnValue("Length", value); }

		}

		  
		[XmlAttribute("ClassCode")]
		public string ClassCode 
		{
			get { return GetColumnValue<string>("ClassCode"); }

			set { SetColumnValue("ClassCode", value); }

		}

		  
		[XmlAttribute("Pages")]
		public int? Pages 
		{
			get { return GetColumnValue<int?>("Pages"); }

			set { SetColumnValue("Pages", value); }

		}

		  
		[XmlAttribute("Measure")]
		public string Measure 
		{
			get { return GetColumnValue<string>("Measure"); }

			set { SetColumnValue("Measure", value); }

		}

		  
		[XmlAttribute("ColorCode")]
		public int? ColorCode 
		{
			get { return GetColumnValue<int?>("ColorCode"); }

			set { SetColumnValue("ColorCode", value); }

		}

		  
		[XmlAttribute("ProductID")]
		public int? ProductID 
		{
			get { return GetColumnValue<int?>("ProductID"); }

			set { SetColumnValue("ProductID", value); }

		}

		  
		[XmlAttribute("ProdVersionID")]
		public int ProdVersionID 
		{
			get { return GetColumnValue<int>("ProdVersionID"); }

			set { SetColumnValue("ProdVersionID", value); }

		}

		  
		[XmlAttribute("CategoryID")]
		public int? CategoryID 
		{
			get { return GetColumnValue<int?>("CategoryID"); }

			set { SetColumnValue("CategoryID", value); }

		}

		  
		[XmlAttribute("SubSectorID")]
		public int? SubSectorID 
		{
			get { return GetColumnValue<int?>("SubSectorID"); }

			set { SetColumnValue("SubSectorID", value); }

		}

		  
		[XmlAttribute("SectorID")]
		public int? SectorID 
		{
			get { return GetColumnValue<int?>("SectorID"); }

			set { SetColumnValue("SectorID", value); }

		}

		  
		[XmlAttribute("BrandID")]
		public int? BrandID 
		{
			get { return GetColumnValue<int?>("BrandID"); }

			set { SetColumnValue("BrandID", value); }

		}

		  
		[XmlAttribute("AdvertiserID")]
		public int? AdvertiserID 
		{
			get { return GetColumnValue<int?>("AdvertiserID"); }

			set { SetColumnValue("AdvertiserID", value); }

		}

		  
		[XmlAttribute("ImageName")]
		public string ImageName 
		{
			get { return GetColumnValue<string>("ImageName"); }

			set { SetColumnValue("ImageName", value); }

		}

		  
		[XmlAttribute("AgencyID")]
		public int? AgencyID 
		{
			get { return GetColumnValue<int?>("AgencyID"); }

			set { SetColumnValue("AgencyID", value); }

		}

		  
		[XmlAttribute("DateAdded")]
		public DateTime DateAdded 
		{
			get { return GetColumnValue<DateTime>("DateAdded"); }

			set { SetColumnValue("DateAdded", value); }

		}

		  
		[XmlAttribute("DateModified")]
		public DateTime DateModified 
		{
			get { return GetColumnValue<DateTime>("DateModified"); }

			set { SetColumnValue("DateModified", value); }

		}

		
		#endregion
		
		
			
		
		#region ForeignKey Properties
		
		/// <summary>
		/// Returns a Country ActiveRecord object related to this InternetLog
		/// 
		/// </summary>
		public Adex.Country Country
		{
			get { return Adex.Country.FetchByID(this.CountryID); }

			set { SetColumnValue("CountryID", value.CountryID); }

		}

		
		
		/// <summary>
		/// Returns a InternetBody ActiveRecord object related to this InternetLog
		/// 
		/// </summary>
		public Adex.InternetBody InternetBody
		{
			get { return Adex.InternetBody.FetchByID(this.InternetBodyCode); }

			set { SetColumnValue("InternetBodyCode", value.InternetBodyCode); }

		}

		
		
		/// <summary>
		/// Returns a InternetColor ActiveRecord object related to this InternetLog
		/// 
		/// </summary>
		public Adex.InternetColor InternetColor
		{
			get { return Adex.InternetColor.FetchByID(this.ColorCode); }

			set { SetColumnValue("ColorCode", value.ColorCode); }

		}

		
		
		/// <summary>
		/// Returns a Medium ActiveRecord object related to this InternetLog
		/// 
		/// </summary>
		public Adex.Medium Medium
		{
			get { return Adex.Medium.FetchByID(this.MediaCode); }

			set { SetColumnValue("MediaCode", value.MediaCode); }

		}

		
		
		#endregion
		
		
		
		//no ManyToMany tables defined (0)
		
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(byte? varCountryID,DateTime? varRFDate,int? varMediaCode,int? varTimeStart,int? varTimeEnd,int? varPageNumber,int? varInternetBodyCode,string varTipology,decimal? varRealCost,double? varWide,int? varPageType,double? varLength,string varClassCode,int? varPages,string varMeasure,int? varColorCode,int? varProductID,int varProdVersionID,int? varCategoryID,int? varSubSectorID,int? varSectorID,int? varBrandID,int? varAdvertiserID,string varImageName,int? varAgencyID,DateTime varDateAdded,DateTime varDateModified)
		{
			InternetLog item = new InternetLog();
			
			item.CountryID = varCountryID;
			
			item.RFDate = varRFDate;
			
			item.MediaCode = varMediaCode;
			
			item.TimeStart = varTimeStart;
			
			item.TimeEnd = varTimeEnd;
			
			item.PageNumber = varPageNumber;
			
			item.InternetBodyCode = varInternetBodyCode;
			
			item.Tipology = varTipology;
			
			item.RealCost = varRealCost;
			
			item.Wide = varWide;
			
			item.PageType = varPageType;
			
			item.Length = varLength;
			
			item.ClassCode = varClassCode;
			
			item.Pages = varPages;
			
			item.Measure = varMeasure;
			
			item.ColorCode = varColorCode;
			
			item.ProductID = varProductID;
			
			item.ProdVersionID = varProdVersionID;
			
			item.CategoryID = varCategoryID;
			
			item.SubSectorID = varSubSectorID;
			
			item.SectorID = varSectorID;
			
			item.BrandID = varBrandID;
			
			item.AdvertiserID = varAdvertiserID;
			
			item.ImageName = varImageName;
			
			item.AgencyID = varAgencyID;
			
			item.DateAdded = varDateAdded;
			
			item.DateModified = varDateModified;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varInternetLogID,byte? varCountryID,DateTime? varRFDate,int? varMediaCode,int? varTimeStart,int? varTimeEnd,int? varPageNumber,int? varInternetBodyCode,string varTipology,decimal? varRealCost,double? varWide,int? varPageType,double? varLength,string varClassCode,int? varPages,string varMeasure,int? varColorCode,int? varProductID,int varProdVersionID,int? varCategoryID,int? varSubSectorID,int? varSectorID,int? varBrandID,int? varAdvertiserID,string varImageName,int? varAgencyID,DateTime varDateAdded,DateTime varDateModified)
		{
			InternetLog item = new InternetLog();
			
				item.InternetLogID = varInternetLogID;
				
				item.CountryID = varCountryID;
				
				item.RFDate = varRFDate;
				
				item.MediaCode = varMediaCode;
				
				item.TimeStart = varTimeStart;
				
				item.TimeEnd = varTimeEnd;
				
				item.PageNumber = varPageNumber;
				
				item.InternetBodyCode = varInternetBodyCode;
				
				item.Tipology = varTipology;
				
				item.RealCost = varRealCost;
				
				item.Wide = varWide;
				
				item.PageType = varPageType;
				
				item.Length = varLength;
				
				item.ClassCode = varClassCode;
				
				item.Pages = varPages;
				
				item.Measure = varMeasure;
				
				item.ColorCode = varColorCode;
				
				item.ProductID = varProductID;
				
				item.ProdVersionID = varProdVersionID;
				
				item.CategoryID = varCategoryID;
				
				item.SubSectorID = varSubSectorID;
				
				item.SectorID = varSectorID;
				
				item.BrandID = varBrandID;
				
				item.AdvertiserID = varAdvertiserID;
				
				item.ImageName = varImageName;
				
				item.AgencyID = varAgencyID;
				
				item.DateAdded = varDateAdded;
				
				item.DateModified = varDateModified;
				
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}

		#endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string InternetLogID = @"InternetLogID";
			 public static string CountryID = @"CountryID";
			 public static string RFDate = @"RFDate";
			 public static string MediaCode = @"MediaCode";
			 public static string TimeStart = @"TimeStart";
			 public static string TimeEnd = @"TimeEnd";
			 public static string PageNumber = @"PageNumber";
			 public static string InternetBodyCode = @"InternetBodyCode";
			 public static string Tipology = @"Tipology";
			 public static string RealCost = @"RealCost";
			 public static string Wide = @"Wide";
			 public static string PageType = @"PageType";
			 public static string Length = @"Length";
			 public static string ClassCode = @"ClassCode";
			 public static string Pages = @"Pages";
			 public static string Measure = @"Measure";
			 public static string ColorCode = @"ColorCode";
			 public static string ProductID = @"ProductID";
			 public static string ProdVersionID = @"ProdVersionID";
			 public static string CategoryID = @"CategoryID";
			 public static string SubSectorID = @"SubSectorID";
			 public static string SectorID = @"SectorID";
			 public static string BrandID = @"BrandID";
			 public static string AdvertiserID = @"AdvertiserID";
			 public static string ImageName = @"ImageName";
			 public static string AgencyID = @"AgencyID";
			 public static string DateAdded = @"DateAdded";
			 public static string DateModified = @"DateModified";
						
		}

		#endregion
	}

}

